package com.example.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class dollarRateConfig extends AppCompatActivity {
    EditText dt;
    EditText et;
    EditText wt;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_dollar_rate_config);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            dt=findViewById(R.id.dollarR);
            et=findViewById(R.id.euroR);
            wt=findViewById(R.id.wonR);
            return insets;
        });
    }
    public void click(View btn){
        if(dt.getText()!=null&&et.getText()!=null&&wt.getText()!=null){
            float dr=Float.parseFloat(dt.getText().toString());
            float er=Float.parseFloat(et.getText().toString());
            float wr=Float.parseFloat(wt.getText().toString());
            Intent intent=new Intent(dollarRateConfig.this, MainActivity3.class);
            Bundle bundle=new Bundle();
            bundle.putFloat("dr",dr);
            bundle.putFloat("er",er);
            bundle.putFloat("wr",wr);
            intent.putExtras(bundle);
            startActivity(intent);
        }

    }
}